package com.example.mygame.mystick;

import android.graphics.Canvas;
import android.graphics.Paint;

public class MyLine {
	boolean isVisable;
	float startX;
	float startY;
	float stopX;
	float stopY;
	
	public MyLine(float startX, float startY, float stopX, float stopY) {
		super();
		isVisable = true;
		this.startX = startX;
		this.startY = startY;
		this.stopX = stopX;
		this.stopY = stopY;
	}
	
	public boolean isVisable() {
		return isVisable;
	}

	public void setVisable(boolean isVisable) {
		this.isVisable = isVisable;
	}

	public void draw(Canvas canvas, Paint paint) {
		canvas.drawLine(startX, startY, stopX, stopY, paint);
	}
	
	public double getLength() {
		return Math.sqrt( (stopX -startX)*(stopX -startX)
				+(stopY -startY)*(stopY -startY) );
	}

	public float getStartX() {
		return startX;
	}

	public void setStartX(float startX) {
		this.startX = startX;
	}

	public float getStartY() {
		return startY;
	}

	public void setStartY(float startY) {
		this.startY = startY;
	}

	public float getStopX() {
		return stopX;
	}

	public void setStopX(float stopX) {
		this.stopX = stopX;
	}

	public float getStopY() {
		return stopY;
	}

	public void setStopY(float stopY) {
		this.stopY = stopY;
	}

	public void setOffset(int offset) {
		this.startX += offset;
		this.stopX += offset;
		
	}
	
	
	
	
}
